import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import { ServiceBasic } from '../../kalend';

@Injectable()
export class UserService extends ServiceBasic {

  constructor(http: Http) {
    super('/user', http);
  }

  login(account: string, password: string): Promise<any> {
    const param = { phone: account, password: password };
    return this.httppost('/login', param);
  }
  query(doc: any) {
    return this.httppost(`/query`, doc);
  }
  export(doc: any) {
    return this.httppost(`/export`, doc);
  }
  /**查询单条信息 */
  queryById(id: any) {
    return this.httpget(`/queryById/${id}`);
  }
  /**禁用 */
  lock(id: any) {
    return this.httpget(`/lock/${id}`);
  }
  /**启用 */
  open(id: any) {
    return this.httpget(`/open/${id}`);
  }
  /**禁用 */
  setsender(id: any) {
    return this.httpget(`/setsender/${id}`);
  }
  /**启用 */
  nosender(id: any) {
    return this.httpget(`/nosender/${id}`);
  }
  /** 查询邀请记录 */
  queryinver(doc: any) {
    return this.httppost(`/queryinver`, doc);
  }

  getqrcode(doc:any){
    return this.httppost(`/getuserqrcode`, doc);
  }

  getuserinfobyphone(doc: any) {
    return this.httppost(`/getuserinfobyphone`, doc);
  }

  upwine(doc: any) {
    return this.httppost(`/upwine`, doc);
  }

}
